package com.poetry.jianjia.net;

import java.util.List;
import java.util.Map;

import okhttp3.ResponseBody;
import poetry.jianjia.Call;
import poetry.jianjia.http.BaseUrl;
import poetry.jianjia.http.Field;
import poetry.jianjia.http.FieldMap;
import poetry.jianjia.http.FormUrlEncoded;
import poetry.jianjia.http.GET;
import poetry.jianjia.http.POST;
import poetry.jianjia.http.Path;
import poetry.jianjia.http.Query;
import poetry.jianjia.http.QueryMap;
import poetry.jianjia.http.Url;

/**
 * @author 裴云飞
 * @date 2021/1/23
 */

public interface Wan {

    @GET("article/list/{page}/json")
    Call<ResponseBody> getArticle(@Path("page") int page);

    @GET("article/list/{page}/json")
    Call<Article> getHomeArticle(@Path("page") int page);

    @GET()
    Call<ResponseBody> getArticle(@Url String url);

    @GET("wxarticle/list/405/1/json")
    Call<ResponseBody> search(@Query("k") String k);

    @GET("wxarticle/list/405/1/json")
    Call<ResponseBody> search(@Query("k") String... k);

    @GET("wxarticle/list/405/1/json")
    Call<ResponseBody> search(@Query("k") List<String> k);

    @GET("wxarticle/list/405/1/json")
    Call<ResponseBody> search(@QueryMap Map<String, String> param);

    @GET("article/list/0/json")
    Call<ResponseBody> getArticle(@QueryMap Map<String, String> param);

    @BaseUrl("https://api.apiopen.top")
    @GET("getJoke")
    Call<ResponseBody> getJoke(@QueryMap Map<String, String> param);

    @POST("user/login")
    @FormUrlEncoded
    Call<ResponseBody> login(@Field("username") String username, @Field("password") String password);

    @POST("user/login")
    @FormUrlEncoded
    Call<ResponseBody> login(@FieldMap Map<String, String> map);

    @GET("banner/json")
    Call<Banner> getBanner();
}
